<template>
  <div class='container'>
    <div class='menu'>
      <div class='bigtitle'><span class='shu'></span>工作板块</div>
      <ul class='menu_ul flex'>
        <li class='flex-item'>
          <span class="menu_icons rcgl"></span>
          <span class='words'>日程管理</span>
        </li>
        <li class='flex-item' @tap='goto_manage_worker'>
          <span class="menu_icons yggl"></span>
          <span class='words'>员工管理</span>
        </li>
        <li class='flex-item' @tap='goto_ecological_shop'>
          <span class="menu_icons stdw"></span>
          <span class='words'>生态店务</span>
        </li>
        <li class='flex-item' @tap='goto_manage_kaoqin'>
          <span class="menu_icons kqsh"></span>
          <span class='words'>考勤审核</span>
        </li>
        <li class='flex-item' @click='notopen'>
          <span class="menu_icons cwgl"></span>
          <span class='words'>财务管理</span>
        </li>
        <li class='flex-item' @click='notopen'>
          <span class="menu_icons ckgl"></span>
          <span class='words'>仓库管理</span>
        </li>
      </ul>
      <div class='bigtitle mt22'><span class='shu'></span>学习板块</div>
      <div class='bigtitle mt22'><span class='shu'></span>应用板块</div>
    </div>
  </div>
</template>

<script>
import wx from 'wx'
import Toast from '@/utils/toast'
export default {
  data () {
    return {
      authority: '',
      floor: 0,
      ismanage: 0,
      multipleSort: false
    }
  },
  onShow () {
    this.authority = wx.getStorageSync('userInfo').authority
    this.ismanage = wx.getStorageSync('userInfo').ismanage
    this.floor = wx.getStorageSync('userInfo').floor
  },
  components: {
  },
  methods: {
    goto_manage_worker () {
      if (this.floor == 3 || this.ismanage == 0) { // eslint-disable-line
        Toast('您没有权限审核考勤！', 'noicon');
        return false;
      }
      wx.navigateTo({
        url: '/pages/worker/employeeManagement/employeeManagement'
      })
    },
    goto_manage_kaoqin () {
      if (this.floor == 3 || this.ismanage == 0) { // eslint-disable-line
        Toast('您没有权限审核考勤！', 'noicon');
        return false;
      }
      if (!this.authority.manage_up_kaoqin) {
        Toast('您没有权限审核考勤！', 'noicon');
        return false;
      }
      wx.navigateTo({
        url: '/pages/worker/attendanceExamination/attendanceExamination'
      })
      // pages/attendanceExamination/attendanceExamination
    },
    notopen () {
      Toast('暂未开放！', 'noicon');
      return false;
    },
    goto_ecological_shop () {
      wx.navigateTo({
        url: '/pages/guest/shoplist/shoplist'
      })
    }
  },
  created () {
    // 调用应用实例的方法获取全局数据
    // this.getUserInfo()
  }
}
</script>

<style scoped>
.container {
}
.menu {
  width: 100%;
  background: #fff;
  box-shadow: 0px 6rpx 20rpx rgba(255, 68, 68, 0.1);
  padding: 28rpx 32rpx;
}
.bigtitle {
  font-size: 32rpx;
  font-weight: bold;
  line-height: 42rpx;
  color: rgba(51, 51, 51, 1);
}
.bigtitle .shu {
  display: inline-block;
  width: 4rpx;
  height: 20rpx;
  background: rgba(255, 68, 68, 1);
  border-radius: 2rpx;
  margin-right: 12rpx;
}
.menu_ul {
  width: 100%;
  padding: 34rpx 0rpx;
  background: #fff;
  flex-wrap: wrap;
}
.menu_ul li {
  margin-right: 140rpx;
  margin-bottom: 40px;
}
.menu_ul li .menu_icons {
  display: block;
  width: 90rpx;
  height: 102rpx;
  margin: 0 auto;
}
.menu_ul li .menu_icons.rcgl {
  background: url(http://mytimg.178mr.com/richeng_icon.png) no-repeat center;
  background-size: 100%;
}
.menu_ul li .menu_icons.yggl {
  background: url(http://mytimg.178mr.com/yuangong_icon.png) no-repeat center;
  background-size: 100%;
}
.menu_ul li .menu_icons.stdw {
  background: url(http://mytimg.178mr.com/shengtai_icon.png) no-repeat center;
  background-size: 100%;
}
.menu_ul li .menu_icons.kqsh {
  background: url(http://mytimg.178mr.com/kaoqin_icon.png) no-repeat center;
  background-size: 100%;
}
.menu_ul li .menu_icons.cwgl {
  background: url(http://mytimg.178mr.com/caiwu_icon.png) no-repeat center;
  background-size: 100%;
}
.menu_ul li .menu_icons.ckgl {
  background: url(http://mytimg.178mr.com/cangku_icon.png) no-repeat center;
  background-size: 100%;
}
.menu_ul li:nth-child(3) {
  margin-right: 0;
}
.menu_ul li:nth-child(6) {
  margin-right: 0;
}
.menu_ul li:nth-child(4),
.menu_ul li:nth-child(5),
.menu_ul li:nth-child(6) {
  margin-bottom: 0;
}
.menu_ul li .words {
  display: block;
  margin-top: 20rpx;
  font-size: 28rpx;
  font-weight: 400;
  line-height: 38rpx;
  color: rgba(102, 102, 102, 1);
  opacity: 1;
  text-align: center;
}
.mt22 {
  margin-top: 22rpx;
}
</style>
